package com.caxxb.service.impl;

import com.caxxb.dao.ShoppingCartDao;
import com.caxxb.dao.impl.ShoppingCartDaoImpl;
import com.caxxb.service.ShoppingCatService;
import com.caxxb.util.PageData;

import java.util.List;

public class ShoppingCartServiceImpl implements ShoppingCatService {

    private ShoppingCartDao shoppingCartDao=new ShoppingCartDaoImpl();

    @Override
    public List getCartsByUserId(int userid) {
        return shoppingCartDao.getCartsByUserId(userid);
    }

    @Override
    public List getCartById(int userid, int gameid) {
        return shoppingCartDao.getCartById(userid, gameid);
    }


    @Override
    public boolean addToCart(int gameid, int userid, double gameprice) {
        return shoppingCartDao.addToCart(gameid, userid, gameprice);
    }

    @Override
    public boolean delCartById(int userid, int gameid) {
        return shoppingCartDao.delCartById(userid, gameid);
    }

    @Override
    public boolean delCartByCartId(int cartid) {
        return shoppingCartDao.delCartByCartId(cartid);
    }
}
